home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2312 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.mel.aone.net.au!usenet
  2. From: clyde@hitech.com.au (Clyde Smith-Stubbs)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Problem with c code, please help!
  5. Date: Sat, 20 Jan 1996 11:54:47 GMT
  6. Organization: HI-TECH Software
  7. Message-ID: <3100d784.204286080@news.bne.aone.net.au>
  8. References: <surgsw-1901960148530001@128.206.206.86> <mikedorman-1901960725380001@205.148.200.150>
  9. Reply-To: clyde@hitech.com.au
  10. NNTP-Posting-Host: skyhawk.hitech.com.au
  11. X-Newsreader: Forte Agent .99c/16.141
  12.  
  13. On Fri, 19 Jan 1996 07:25:37 -0600, mikedorman@cedarnet.com (Mike
  14. Dorman) wrote:
  15.  
  16. >main()
  17. >{ 
  18. >   char *word;
  19. >
  20. >   puts("Enter a word: ");
  21. >   while(scanf("%s", word) != 0)
  22. >
  23. >   puts("You entered: ");
  24. >   puts(word);
  25. >}
  26.  
  27. Now woa Neddie! There's one major problem with this code - word is a
  28. pointer that points to nothing in particular. This code is guaranteed
  29. to randomly crash in a big way. Furthermore you've got a loop there
  30. that is certainly not what was intended. Please check your code before
  31. posting!
  32. ----
  33.  Clyde Smith-Stubbs       | HI-TECH Software,       | Voice: +61 7 3300 5011
  34.  clyde@hitech.com.au      | P.O. Box 103, Alderley, | Fax:   +61 7 3300 5246
  35. http://www.hitech.com.au  | QLD, 4051, AUSTRALIA.   | BBS:   +61 7 3300 5235
  36. ----------------------------------------------------------------------------
  37. FREE! Download our shareware (FREE for noncommercial use) MS-DOS C Compiler!
  38.              Point your Web browser at http://www.hitech.com.au/
  39.